$().ready(function() {
    $("#address_form").validate({
        errorElement: "em",
        errorContainer: $("#warning"),
        errorPlacement: function(error, element) {
            error.appendTo( element.next("span"));
        },
        success: function(label) {
            label.text("ok!").addClass("success");
        },
        rules: {
            "address[street]": {
                required: true
            },
            "address[mobile]": {
                required: true
            },
            "address[receiver]": {
                required: true
            }
        },

        messages: {
            "address[street]": {
                required: "请输入地址."
            },
            "address[mobile]": {
                required: "请输入手机号,非常重要"
            },
            "address[receiver]": {
                required: "请输入收件人."
            }
        }

    });
});
